package com.bcmusic.authorization.feign;

import com.bcmusic.authorization.pojo.Authorization;
import entity.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;


/**
 * @author yg
 */
@FeignClient("authorization")
@RequestMapping("/authorization")
public interface AuthorizationFeign {
    /**
     * 根据订单所对应的购物车中的商品添加,支付接口回调
     * @param orderId
     * @return
     */
    @ApiOperation(value = "根据订单所对应的购物车中的商品添加", notes = "许可类型商品在商品页面调用这个接口将物品添加到购物车中")
    @PostMapping("addAuthorization")
    public Result addAuthorization(@RequestParam Integer orderId);

    /**
     * 根据音乐id查询这首音乐当前生效的转让信息
     * @param musicId
     * @return
     */
    @ApiIgnore
    @ApiOperation(value = "根据音乐id查询这首音乐当前生效的转让信息", notes = "根据音乐id查询这首音乐当前生效的转让信息")
    @PostMapping("getCurrentTransferById")
    public Result<List<Authorization>> getCurrentTransferById(@RequestParam Integer musicId);
}
